package com.shop.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectRabbitConfig {

    @Bean
    public Queue phonepMsg() {
        return new Queue("phoneCodeQueue", true);
    }

    @Bean
    DirectExchange phoneCodeExchange() {
        return new DirectExchange("phoneCodexchange",true,false);
    }

    @Bean
    Binding bindingDirect() {
        return BindingBuilder.bind(phonepMsg()).to(phoneCodeExchange()).with("phoneCodexRoute");
    }





}
